home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #017 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #017 (199x)(Scope PD)(US)[WB].adf
/
BShell
/
bsh.doc
< prev
next >
Wrap
Text File
|
1988-07-13
|
9KB
|
234 lines
bsh preliminary docs
NAME
bsh - A simple shell with last command recall
PURPOSE
After finally getting a chance to read through the
functions in arp.library I wanted to write a program to
try them out. One of the things that I have wanted on
the Amiga was the ability to go back and edit a command
previously typed. I also wanted the ability to use
pipes (|) between concurrent processes easily as in the
Unix shells. This is not currently implemented
unfortunately as I want to see what the pipe device is
like that comes with 1.3 before adding that feature.
This shell relies on the arp.library (V34) and the Arp
commands to provide much of its functionality. It does
not have many built in commands as it is assumed that
you will either use REZ or the Arp Resident command.
See the section RESIDENT below for more information.
As I have seen some interest in using the Arp Resident
command, and some others may also be interested in a
simple shell with last command recall, I am
distributing the shell, though as a use at your own
risk program (ie. it has not yet been extensively
tested).
BUILT IN COMMANDS
The following functions are built into the shell:
bind -- bind str1 str2
The bind function causes the first string
to be mapped to the second. The binding is a
low level function done before any parsing of
the input is done. It is not done
recursively so no danger exists of infinitely
long expansions. The most common use of this
function is to map the function keys to
useful strings. Another use is to map the
control keys and the arrow keys to internal
shell functions... this is currently done
automatically by the shell. A future version
will use a startup script, which will do the
bindings, allowing for customization of the
key sequences used. It also allows you to
"bind x y" which will make all x's typed
become y's, but be careful as there is no
way to unbind a string. The first string may
not contain spaces, though the second string
can.
Example of use:
June 24, 1988 Page 1
bsh preliminary docs
bind *x9b4~ list bsh*x0d
The above command will bind the F5 function
key to generate the string "list bsh" when
typed. The *x0d at the end causes it to also
act as if the return key has been pressed.
The above assumes that you have left Arp's
settings to use BCPL escape sequences. See
Arp's set command and the EscapeString() man
page for more information.
clear -- clear
The clear command clears the window that the
shell in which you issued the command is
running in. Currently bound to ^L also.
exit -- exit
This is the command to get out of bsh
and return to the normal CLI that bsh was
invoked from. Currently bound to ^D also.
ver -- ver
This command prints out the version
number of bsh that you are running. This
number should be given in any bug report etc
on bsh.
COMMAND LINE EDITING
The last twenty commands typed are saved and can be
recalled, edited and resubmitted. The functions
available for editing the commands and the default
bindings are described below.
MOVE RIGHT
Moves the cursor nondestructively to the
right. This function is bound to the right
arrow key.
MOVE LEFT
Moves the cursor nondestructively to the
left. This function is bound to the left
arrow key.
NEXT COMMAND
If you pass the command you want, the next
command function moves back through the
command history. This function is bound to
the down arrow key.
PREVIOUS COMMAND
Recalls the command that was typed before the
command being shown on the command line, up
to the history limit (currently the last
June 24, 1988 Page 2
bsh preliminary docs
twenty commands). This function is bound to
the up arrow key.
REDRAW LINE
Reprints the current command. Useful after
you have resized the window. This function
is bound to the key ^R.
DELETE CHAR
Delete the character currently under the
cursor. This function is bound to the delete
key.
DELETE CHAR LEFT
Delete the character to the left of the
cursor. This function is bound to the
backspace key.
DISPLAY HISTORY
Shows the commands stored in the history
buffer. This function is bound to the escape
key.
RESIDENT
The use of either the Arp resident program or the
program REZ is extremely recommended. Please see the
documentation that comes with these programs for
information on there use. Arp's Resident program is
more limited in some ways then REZ. Arp's resident
sets up a list of the resident programs that must be
searched before looking to the disk for a program and
requires the program to meet tougher qualifications
then REZ. REZ patches the LoadSeg() function and thus
works with the standard CLI also. REZ also allows more
programs to be made resident then Arp's Resident. REZ
seems to require more overhead then Arp's Resident
though. If all you are going to make Resident is Arp's
own commands then you should probably use Arp's
Resident... otherwise if you want to access the
commands from the standard CLI also, or you want to
make other programs resident besides Arp's you should
use REZ.
KNOWN LIMITATIONS
As bsh uses arp.library functions to execute all
external commands (this is what allows the shell to
utilize Arp's Resident program feature) it will not
pass arguments to BCPL programs. In addition I have
found that programs compiled under Manx 3.2a will not
be passed arguments also. This means that the run
command can not be used.... use the arun command
supplied with Arp instead. To make this easier the F1
key is bound to the string "arun ".
June 24, 1988 Page 3
bsh preliminary docs
Some programs crash when invoked from bsh when
they are exited... one that I have found is
WordPerfect. I am not sure if this is a bug in the
SyncRun() function, the shell, or those programs that
crash on exit.
As a result of the way bsh parses the command
line, no spaces are allowed in the command argument.
In other words the name of the program to execute must
not have any spaces in it.
June 24, 1988 Page 4